#include "fileop.h"
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonObject>
#include <QDateTime>

FileOP::FileOP(QObject *parent) : QObject(parent)
{

}

QString FileOP::readLine(QString name, int seek)
{
    QFile file(name);
    QString str = "";
    if (file.open(QIODevice::ReadWrite | QIODevice::Text))
    {
        QTextStream stream(&file);
        stream.seek(seek);
        str = stream.readLine();
        file.close();
        return str;
    }
    return "NULL";
}
QString FileOP::getTime(int sec)
{
    QDateTime time1 = QDateTime::currentDateTime();
    time1.setTime_t(sec);
    QString str = time1.toString();
    return str;
}
